<div class="sidebar-widget" style="margin: -1px 0 0 0;">
	<h5 class="title" style="margin-bottom:0">Menu Navigasi</h5>
</div><!-- End .sidenav-widget -->

<div class="mainnav">
	<ul>
		<!--
		<li>
			<a href="javascript:void(0)"><span class="icon16 icomoon-icon-list"></span>Master</a>
			<ul class="sub">
				<li><a href="<?php echo site_url("master/grid_periode"); ?>"><span class="icon16 icomoon-icon-file"></span>Master Periode</a></li>
				<li><a href="<?php echo site_url("master/form_user"); ?>"><span class="icon16 icomoon-icon-file"></span>Master User</a></li>
			</ul>
		</li>
		-->
		<li><a href="<?php echo site_url("master/grid_periode"); ?>"><span class="icon16 icomoon-icon-list"></span>Master Periode</a></li>
		<!--<li><a href="<?php echo site_url("peta"); ?>" target="_blank"><span class="icon16 entypo-icon-globe"></span>Peta Jalan</a></li>-->
		<li>
			<a href="javascript:void(0)"><span class="icon16 icomoon-icon-direction"></span>Ruas Jalan</a>
			<ul class="sub">
				<li><a href="<?php echo site_url("ruas_jalan/form_upload_rj"); ?>"><span class="icon16 icomoon-icon-file"></span>Upload Berkas</a></li>
				<!--<li><a href="<?php echo site_url("ruas_jalan/form_upload_rute"); ?>"><span class="icon16 icomoon-icon-file"></span>Upload Rute Jalan</a></li>-->
				<li><a href="<?php echo site_url("ruas_jalan/grid_rj"); ?>"><span class="icon16 icomoon-icon-file"></span>Tabel Jalan</a></li>
			</ul>
		</li>
		<li><a href="<?php echo site_url("rekap"); ?>"><span class="icon16 icomoon-icon-download"></span>Ekspor Rekap Data</a></li>
	</ul>
</div>

<div class="sidebar-widget">
	<h5 class="title">Jumlah Jalan Bagus</h5>
	<?php 
		$data =  $this->ruas_jalan_model->get_persen();
		foreach($data as $row)
		{
			$total_jalan 	= $row["TOTAL_JALAN"];
			$total_baik 	= $row["KONDISI_BAIK"];
			$jumlah 		= $row["JUMLAH_JALAN"];
			$mantap			= $row["MANTAP"];
			$tidak_mantap	= $row["TIDAK_MANTAP"];
		}
		if($total_jalan == NULL || $total_jalan == 0)
		{
			$persentase 		= 0;
			$persen_mantap 		= 0;
			$persen_tmantap 	= 0;
		}
		else
		{
			$persentase 		= ($total_baik / $total_jalan) * 100;
			$persen_mantap 		= ($mantap / $total_jalan) * 100;
			$persen_tmantap 	= ($tidak_mantap / $total_jalan) * 100;
		}
	?>
	<div class="content">
		<span class="icon16 icomoon-icon-road left"></span>
		<div class="progress progress-mini left tip" title="<?php echo number_format($persentase,0)?>%">
		  <div class="progress-bar progress-bar-primary" style="width: <?php echo $persentase?>%;"></div>
		</div>
		<span class="percent"><?php echo number_format($persentase,0)?>%</span>
		<div class="stat"><?php echo number_format($total_baik,2);?> / <?php echo number_format($total_jalan,2);?> KM</div>
	</div>
</div>

<div class="sidebar-widget">
	<h5 class="title">Kemantapan Jalan</h5>
	<div class="content">
		<span class="icon16 silk-icon-star left"></span>
		<div class="progress progress-mini left tip" title="<?php echo number_format($persen_mantap,0)?>%">
		  <div class="progress-bar progress-bar-success" style="width: <?php echo $persen_mantap?>%;"></div>
		</div>
		<span class="percent"><?php echo number_format($persen_mantap,0)?>%</span>
		<div class="stat">Mantap</div>
	</div>
	<div class="content">
		<span class="icon16 silk-icon-star-empty left"></span>
		<div class="progress progress-mini left tip" title="<?php echo number_format($persen_tmantap,0)?>%">
		  <div class="progress-bar progress-bar-danger" style="width: <?php echo $persen_tmantap?>%;"></div>
		</div>
		<span class="percent"><?php echo number_format($persen_tmantap,0)?>%</span>
		<div class="stat">Tidak Mantap</div>
	</div>
</div>

<div class="sidebar-widget">
	<h5 class="title">Statistik Data</h5>
	<?php 
		$data2 = $this->ruas_jalan_model->hitung_jalan_baik();
		$i = 1;
		if($data2 != NULL)
		{
			foreach($data2 as $row)
			{
					$jumlah_kota = $i++;
			}
		}
		else
		{
			$jumlah_kota = 0;
		}
	?>
	<div class="content">
		<div class="rightnow">
            <ul class="list-unstyled">
				<li><span class="number"><?php echo $jumlah?></span><span class="icon16 icomoon-icon-road"></span>Jalan</li>
				<li><span class="number"><?php echo $jumlah_kota?></span><span class="icon16 icomoon-icon-office"></span>Kota</li>
			</ul>
		</div>
	</div>
</div>